<?phpsession_start();//ob_start();include_once 'include/common.php';include_once 'include/libs/Mobile_Detect.php';global $core;$core = new core();if (!$core->CheckLogin()) {    header('Location:login.php');}$zen_order_id = isset($_GET["id"]) ? intval($_GET["id"]) : 0;$zen_order_data = $core->checkZenOrderByID($zen_order_id);if ($zen_order_data == false) {    header("location: zenOrderList.php");}$detect = new Mobile_Detect();$is_mobile = 0;if ($detect->isMobile() || $detect->isTablet()) {    $is_mobile = 1;}$load_more = 0;$total_result = array();//$list_customer_order = $core->getListCustomerOrder($zen_order_id, 1, $load_more, $total_result, 20);$list_customer_order = $core->getListCustomerOrderFilterByCustomer($zen_order_id, '', '', 1, $load_more, $total_result, 20);$html_category = show_category(0,1,2);function show_category($parent_id = 0,$current_level = 0, $max_level='') {    global $core;    $html = '';    $category = $core->getCategoryByParentId($parent_id);    if ($category) {        foreach ($category as $cate) {            if($max_level > 0 && $current_level < $max_level) {                $total_child_category = $core->getTotalChildCategoryById($cate->category_id);            }else{                $total_child_category = 0;            }            if ($total_child_category > 0) {                $html.='<optgroup label="' . $cate->category_name . '">';                $html.=show_category($cate->category_id,$current_level+1,$max_level);                $html.='</optgroup>';            } else {                $html.=' <option value="' . $cate->category_id . '">' . $cate->category_name . '</option>';            }        }    }    return $html;}?><!DOCTYPE html><html lang="en">    <head>        <!--                Charisma v1.0.0                Copyright 2012 Muhammad Usman                Licensed under the Apache License v2.0                http://www.apache.org/licenses/LICENSE-2.0                http://usman.it                http://twitter.com/halalit_usman        -->        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>        <meta http-equiv="content-language" content="vi"/>        <title>Zen store</title>        <meta name="viewport" content="width=device-width, initial-scale=1.0">        <meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">        <meta name="author" content="Muhammad Usman">        <!--        <meta http-equiv="x-ua-compatible" content="IE=10">	-->        <!-- The styles -->        <link id="bs-css" href="css/bootstrap-cerulean.css" rel="stylesheet">        <style type="text/css">            body {                padding-bottom: 40px;            }            .sidebar-nav {                padding: 9px 0;            }        </style>        <link href="css/bootstrap-responsive.css" rel="stylesheet">        <link href="css/charisma-app.css" rel="stylesheet">        <link href="css/style.css" rel="stylesheet">        <link href="css/jquery-ui-1.8.21.custom.css" rel="stylesheet">        <link href='css/chosen.css' rel='stylesheet'>        <link href='css/uniform.default.css' rel='stylesheet'>        <link href='css/jquery.cleditor.css' rel='stylesheet'>        <link href='css/jquery.iphone.toggle.css' rel='stylesheet'>        <link href='css/uploadify.css' rel='stylesheet'>        <link href='css/bootstrap-datetimepicker.min.css' rel='stylesheet'>        <!--        <link rel="stylesheet" href="css/bootstrap-2.2.2.min.css">                <link rel="stylesheet" href="css/pick-a-color-1.1.8.min.css">	 -->        <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->        <!--[if lt IE 9]>          <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>        <![endif]-->        <!-- The fav icon -->        <link rel="shortcut icon" href="img/favicon.ico">        <!-- jQuery -->        <script src="js/jquery-1.8.3.min.js"></script>        <!-- jQuery UI -->        <script src="js/jquery-ui-1.8.21.custom.min.js"></script>        <!-- transition / effect library -->        <script src="js/bootstrap-transition.js"></script>        <!-- alert enhancer library -->        <script src="js/bootstrap-alert.js"></script>        <!-- modal / dialog library -->        <script src="js/bootstrap-modal.js"></script>        <!-- custom dropdown library -->        <script src="js/bootstrap-dropdown.js"></script>        <!-- scrolspy library -->        <script src="js/bootstrap-scrollspy.js"></script>        <!-- library for creating tabs -->        <script src="js/bootstrap-tab.js"></script>        <!-- library for advanced tooltip -->        <script src="js/bootstrap-tooltip.js"></script>        <!-- popover effect library -->        <script src="js/bootstrap-popover.js"></script>        <!-- button enhancer library -->        <script src="js/bootstrap-button.js"></script>        <!-- accordion library (optional, not used in demo)menu scroll -->        <script src="js/bootstrap-collapse.js"></script>        <!-- autocomplete library -->        <script src="js/bootstrap-typeahead.js"></script>        <script src="js/bootstrap-datetimepicker.min.js"></script>        <!-- library for cookie management -->        <script src="js/jquery.cookie.js"></script>        <script src='js/jquery.dataTables.min.js'></script>        <!-- select or dropdown enhancer -->        <script src="js/jquery.chosen.min.js"></script>        <!-- checkbox, radio, and file input styler -->        <script src="js/jquery.uniform.min.js"></script>        <!-- notification plugin -->        <script src="js/jquery.noty.js"></script>        <!-- rich text editor library -->        <script src="js/jquery.cleditor.min.js"></script>        <!-- for iOS style toggle switch -->        <script src="js/jquery.iphone.toggle.js"></script>        <!-- autogrowing textarea plugin -->        <script src="js/jquery.autogrow-textarea.js"></script>        <!-- history.js for cross-browser state change on ajax -->        <script src="js/jquery.history.js"></script>        <!-- application script for Charisma demo -->        <script src="js/common.js?t=16"></script>        <script src="js/orderDetail.js?t=40"></script>        <script src="js/addPayment.js?t=30"></script>        <?php        if ($is_mobile == 0) {            ?>            <script src="js/scroll_normal.js?t=21"></script>            <?php        } else {            ?>            <script src="js/scroll_mobile.js?t=21"></script>            <?php        }        ?><!--        <script src="js/pick_color/tinycolor-0.9.15.min.js"></script><script src="js/pick_color/pick-a-color.js"></script>	<script type="text/javascript">$(document).ready(function() {$(".pick-a-color").pickAColor();});</script>-->    </head>    <body>        <div id="page-wrap" class="page-wrap body-wrap ">            <div id="page-tray" class="tray transition">                <?php include_once ('new_menu.php'); ?>                <div id="page-content" class="page-content transition profile-page">                    <?php include_once ('navbar.php'); ?>                    <div class="container-fluid">                        <div class="row-fluid">                            <div id="content" class="span12">                                        <div id="toTop" class="icon_scrolltop" ><span>Trở lên trên</span></div>                                <!--                                <div>                                                                    <ul class="breadcrumb">                                                                        <li>                                                                            <a href="#">Home</a> <span class="divider">/</span>                                                                        </li>                                                                        <li>                                                                            <a href="#">Tables</a>                                                                        </li>                                                                    </ul>                                                                </div>-->                                <div class="row-fluid"><a href="javascript:void(0)" class="btn btn-success" id="btn_fullscreen" style="float:right;background-color: #3599D4;margin-right: 10px;">                                        Fullscreen                                                                          </a>                                </div>                                <?php                                if ($_SESSION["user_role"] != 3) {                                    ?>                                    <div class="row-fluid sortable " id='form_add_customer_order'>                                        <div class="box span12">                                            <div class="box-header well" id="title_edit_customer_order" data-original-title>                                                <h2 id="h2_title_create_order"><i class="icon-edit"></i> Thêm chi tiết đơn hàng</h2>                                                <div class="box-icon">                                                    <a href="javascipt:void(0))" class="btn btn-minimize btn-round" id="btn-minimize-add-order"><i class="icon-chevron-down"></i></a>                                                </div>                                            </div>                                            <div id="box-add-customer-order" class="box-content" style="display: none;">                                                <div class="form-horizontal">                                                    <fieldset>                                                        <div class="control-group">                                                            <h4>Thông tin khách hàng </h4>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" ></label>                                                            <div class="controls">                                                                <div class="alert alert-error" id="alert-error-customer" style="display:none">                                                                </div>                                                            </div>                                                        </div>                                                        <input type="hidden" name="customer_id" id="customer_id" value="">                                                        <input type="hidden" name="product_id" id="product_id" value="0">                                                        <input type="hidden" name="product_status" id="product_status" value="0">                                                        <div class="control-group">                                                            <label class="control-label" for="product_name">Hướng dẫn: </label>                                                            <div class="controls">                                                                <div class="input-append" style="background-color:yellow">                                                                    Ấn nút check phone hoặc Fb name để hệ thống tự động lấy dữ liệu đơn hàng của khách nếu có để chỉnh sửa.<br/>                                                                    Nếu không hệ thống sẽ tự động tạo đơn hàng mới cho khách này.                                                                </div>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_name">Số điện thoại* </label>                                                            <div class="controls">                                                                <div class="input-append">                                                                    <input type="text" size="16" name="customer_phone" id="customer_phone">                                                                    <button type="button" class="btn" id="get_customer_info">Check phone</button>                                                                </div>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_name">Facebook name* </label>                                                            <div class="controls">                                                                <div class="input-append">                                                                    <input type="text"  name="customer_fb_name" id="customer_fb_name"  >                                                                    <button type="button" class="btn" id="get_customer_by_name">Check fb name</button>                                                                </div>                                                                <ul class="select_fb_name" id="list_customer_fb_name">                                                                </ul>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="customer_name">Name </label>                                                            <div class="controls">                                                                <input type="text" class="span6 typeahead" id="customer_name" value=""   >                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="customer_email">Email </label>                                                            <div class="controls">                                                                <input type="text" class="span6 typeahead" id="customer_email" value=""   >                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_name">Địa chỉ </label>                                                            <div class="controls">                                                                <input type="text" class="span6 typeahead" id="customer_address"  >                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_name">Tỉnh </label>                                                            <div class="controls">                                                                <label class="checkbox inline">                                                                    <div class="checker" id=""><span class=""><input type="checkbox" value="1" id="customer_province" style="opacity: 0;"></span></div>                                                                </label>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="customer_wholesale">Khách buôn </label>                                                            <div class="controls">                                                                <label class="checkbox inline">                                                                    <div class="checker" id=""><span class=""><input type="checkbox" value="1" id="customer_wholesale" style="opacity: 0;" ></span></div>                                                                </label>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_name">Ghi chú đơn hàng của khách này:</label>                                                            <div class="controls">                                                                <textarea name="order_description" id="order_description"></textarea>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <h4>Chọn sản phẩm </h4>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" ></label>                                                            <div class="controls">                                                                <div class="alert alert-error alert-error-product"  style="display:none">                                                                </div>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_name">Mã sản phẩm* </label>                                                            <div class="controls">                                                                <div class="input-append">                                                                    <input type="text"  id="product_code">                                                                    <button type="button" class="btn" id="get_product_info_by_code">Check</button>                                                                </div>                                                            </div>                                                        </div>                                                        <div class="control-group order_detail_new_product hidden">                                                            <label class="control-label" for="product_name">Tên sản phẩm </label>                                                            <div class="controls">                                                                <input type="text"  id="product_name">                                                            </div>                                                        </div>                                                        <div class="control-group order_detail_new_product hidden">                                                            <label class="control-label" for="link_web">Link web</label>                                                            <div class="controls">                                                                <input type="text" class="span6 typeahead" id="link_web" value=""  >                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="main_photo">Ảnh sản phẩm* </label>                                                            <input type="hidden" name="file_name_temp" id="file_main_photo_temp" value="">                                                            <input type="hidden" name="folder_temp" id="folder_temp" value="">                                                            <div class="controls">                                                                <div class="input-append ">                                                                    <input type="text"  id="main_photo">                                                                    <button type="button" class="btn" id="btn_upload_photo">upload photo</button>                                                                    <div>Chọn link ảnh màu tương ứng với màu bạn chọn phía dưới nếu muốn cập nhật ảnh khác</div>                                                                </div>                                                                <div style="margin: 10px;width: 200px; height: 200px;  border: 1px solid #DDDDDD;" id="choose_imge"></div>                                                            </div>                                                        </div>                                                        <div class="control-group order_detail_new_product hidden">                                                            <label class="control-label" for="product_category">Category*</label>                                                            <div class="controls">                                                                <select  id="product_category" >                                                                    <?php echo $html_category; ?>                                                                </select>                                                            </div>                                                        </div><!--                                                        <div class="control-group">--><!--                                                            <label class="control-label" for="manufacture">Brand </label>--><!--                                                            <div class="controls">                                    --><!--                                                                <select id="manufacture" >--><!--                                                                    <option value="Zara">Zara</option>--><!--                                                                    <option value="Mango">Mango</option>--><!--                                                                    <option value="Hm">Hm</option>--><!--                                                                    <option value="Parfumes">Parfumes</option>--><!--                                                                    <option value="Cosmetics">Cosmetics</option>--><!----><!----><!--                                                                </select>--><!----><!--                                                            </div>--><!--                                                        </div>-->                                                        <div class="control-group">                                                            <label class="control-label" for="product_size">Size </label>                                                            <div class="controls">                                                                <select id="product_size" >                                                                </select>                                                                <input type="text"  id="new_size">                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label " for="product_number" >Số lượng* </label>                                                            <div class="controls">                                                                <input type="text"  class="span6 typeahead numbersOnly" style="width:200px" id="product_number"  >                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_color">Màu* </label>                                                            <div class="controls">                                                                <select id="product_color" >                                                                </select>                                                                <input type="text"  id="new_color">                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_price" >Đơn giá*</label>                                                            <div class="controls">                                                                <div class="input-prepend input-append">                                                                    <input class="numbersOnly" id="product_price" type="text" size="16">                                                                    <span class="add-on">000 VNĐ</span>                                                                </div>                                                            </div>                                                        </div>                                                        <div class="control-group  ">                                                            <label class="control-label" for="price_pt" >Giá PT</label>                                                            <div class="controls">                                                                <div class="input-prepend input-append">                                                                    <input class="decimalOnly" id="price_pt" type="text" size="16">                                                                    <span class="add-on">EU</span>                                                                </div>                                                            </div>                                                        </div>                                                        <div class="control-group  ">                                                            <label class="control-label" for="price_at" >Giá AT</label>                                                            <div class="controls">                                                                <div class="input-prepend input-append">                                                                    <input class="decimalOnly" id="price_at" type="text" size="16">                                                                    <span class="add-on">EU</span>                                                                </div>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" for="product_description">Ghi chú sản phẩm</label>                                                            <div class="controls">                                                                <textarea name="product_description" id="product_description"></textarea>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <label class="control-label" ></label>                                                            <div class="controls">                                                                <div class="alert alert-error alert-error-product"  style="display:none">                                                                </div>                                                            </div>                                                        </div>                                                        <div class="control-group">                                                            <div class="controls">                                                                <input type="hidden" name="is_new_product" id="is_new_product" value="0">                                                                <button  class="btn btn-primary noty"  id="add_more_product">Thêm sản phẩm</button>                                                                <button id="reset_form_product" class="btn" type="reset">Cancel product</button>                                                                *Thêm sản phẩm cho khách này trước khi save                                                            </div>                                                        </div>                                                        <table class="table table-striped table-bordered bootstrap-datatable datatable mrk_table_list_order_buy">                                                            <thead>                                                                <tr>                                                                    <th>Mã SP</th>                                                                    <th>Size</th>                                                                    <th>Số Lượng</th>                                                                    <th>Màu</th>                                                                    <th>Ảnh</th>                                                                    <th>Giá<br/>(x1000 VNĐ)</th>                                                                    <th>Ghi chú</th>                                                                    <th>Actions</th>                                                                </tr>                                                            </thead>                                                               <tbody id="tbody_order_product_list">                                                            </tbody>                                                        </table>                                                        <div id="div_order_payment">                                                            <div><b>Điền thông tin đặt cọc nếu có:</b></div>                                                            <div class="control-group">                                                                <label class="control-label" for="new_order_type_payment">Cách thanh toán </label>                                                                <div class="controls">                                                                    <select id="new_order_type_payment">                                                                        <option value="2">Cọc VCB</option>                                                                        <option value="1">Cọc trực tiếp</option>                                                                    </select>                                                                </div>                                                            </div>                                                            <div class="control-group">                                                                <label class="control-label" for="new_order_payment">Số tiền đặt cọc </label>                                                                <div class="controls">                                                                    <input type="text" class="span2 typeahead numbersOnly" id="new_order_payment" style='display:inline-block' ><div style=' margin-left: 5px;display:inline-block'>.000 VNĐ</div>                                                                </div>                                                            </div>                                                            <div class="control-group">                                                                <label class="control-label" for="new_order_payment_date">Ngày đặt cọc </label>                                                                <div class="controls">                                                                    <span id="span_order_payment_date" class="input-append date" style="width: 260px;" >                                                                        <input data-format="dd/MM/yyyy hh:mm" type="text" id="new_order_payment_date" value="Ngày đặt cọc"></input>                                                                        <span class="add-on">                                                                            <i data-time-icon="icon-time" data-date-icon="icon-calendar">                                                                            </i>                                                                        </span>                                                                    </span>                                                                </div>                                                            </div>                                                            <div class="control-group">                                                                <label class="control-label" for="new_order_payment_description">Ghi chú </label>                                                                <div class="controls">                                                                    <textarea name="product_description" id="new_order_payment_description"></textarea>                                                                </div>                                                            </div>                                                        </div>                                                        <div id="div_choose_type_payment">                                                            <div><b>Chọn cách tính tiền cho đơn hàng:</b></div>                                                            <div class="control-group">                                                                <label class="control-label" for="type_calculate_payment">Cách thanh toán </label>                                                                <div class="controls">                                                                    <select id="type_calculate_payment">                                                                        <option value="normal">Tính bình thường</option>                                                                        <option value="at">Tính theo AT</option>                                                                        <option value="pt">Tính theo PT</option>                                                                    </select>                                                                </div>                                                            </div>                                                            <div class="mrk_form_exchange hide">                                                                <div class="control-group">                                                                    <label class="control-label" for="exchange_money">Tỉ giá</label>                                                                    <div class="controls">                                                                        <input type="text" class="span2 typeahead " id="exchange_money" style='display:inline-block' ><div style=' margin-left: 5px;display:inline-block'> X1000 VNĐ/EU</div>                                                                    </div>                                                                </div>                                                            </div>                                                            <div class="mrk_form_calculate_payment hide">                                                                <div class="control-group">                                                                    <label class="control-label" for="percent_service">Phần trăm phụ phí </label>                                                                    <div class="controls">                                                                        <input type="text" class="span2 typeahead " id="percent_service" style='display:inline-block' ><div style=' margin-left: 5px;display:inline-block'>%</div>                                                                    </div>                                                                </div>                                                                <div class="control-group">                                                                    <label class="control-label" for="fee_weight">Phí vận chuyển /KG </label>                                                                    <div class="controls">                                                                        <input type="text" class="span2 typeahead " id="fee_weight" style='display:inline-block' ><div style=' margin-left: 5px;display:inline-block'>EU</div>                                                                    </div>                                                                </div>                                                                <div class="control-group">                                                                    <label class="control-label" for="input_weight">Cân nặng </label>                                                                    <div class="controls">                                                                        <input type="text" class="span2 typeahead " id="input_weight" style='display:inline-block' ><div style=' margin-left: 5px;display:inline-block'>KG</div>                                                                    </div>                                                                </div>                                                            </div>                                                        </div>                                                        <div class="alert alert-error" id="alert-error-order" style="display:none">                                                        </div>                                                        <div class="form-actions">                                                            <button type="submit" class="btn btn-primary" id="save_order_detail">Save changes</button>                                                            <button type="reset" class="btn" id="reset_form">Cancel</button>                                                        </div>                                                    </fieldset>                                                </div>                                               </div>                                        </div><!--/span-->                                    </div><!--/row-->                                    <?php                                }                                ?>                                <div class="row-fluid" id="div_filter">                                    <div class="span12">                                        <div  class="dataTables_length">                                            <div style="display:inline;float: left;font-weight: bold;margin: 15px 5px 0;">Sắp xếp theo:</div>                                             <input style="width: 120px; margin: 10px 0px 0px 0px;" type="text" name="filter_search_text" id="filter_search_text" value="" >                                            <select name="order_by" id="by_product_customer" style="width: 150px; margin: 10px 0px 0px 0px;" >                                                <option value="0" selected="selected">Theo Khách or SP</option>                                                                           <option value="1">Mã sản phẩm</option>                                                <option value="2">Tên FB của khách</option>                                            </select>                                             <select name="order_by" id="by_payment" style="width: 150px; margin: 10px 0px 0px 0px;" >                                                <option value="0" selected="selected">Theo thanh toán</option>                                                <option value="1" >Thanh toán đủ</option>                                                <option value="2" >Thanh toán thừa</option>                                                <option value="3" >Thanh toán thiếu</option>                                                <option value="4" >Đã cọc</option>                                                <option value="5">Chưa thanh toán</option>                                            </select>                                             <select name="order_by" id="by_order_status" style="width: 150px; margin: 10px 0px 0px 0px;" >                                                <option value="0" selected="selected">Theo trạng thái</option>                                                <option value="1" >Store</option>                                                <option value="2">Online</option>                                                <option value="3">Hàng có sẵn</option>                                                <option value="4">Đã nhận hàng</option>                                                <option value="5">Đang shipping</option>                                                <option value="6">Khách đã nhận</option>                                                <option value="7">Hết hàng</option>                                                <option value="8" >ORDER</option>                                                <option value="9">Chưa chắc chắn</option>                                            </select>                                            <select name="order_by" id="by_category" style="width: 150px; margin: 10px 0px 0px 0px;" >                                                <option value="0" selected="selected">Theo Brand</option>                                                <?php echo $html_category; ?>                                            </select>                                            <p></p>                                            <select name="order_by" id="by_province" style="width: 150px;" >                                                <option value="0" selected="selected">Theo tỉnh</option>                                                <option value="1" >Tỉnh</option>                                                <option value="2">Hà Nội</option>                                            </select>                                            <div style="display:inline-block">                                                <span id="datetimepicker_start" class="input-append date" style="width: 260px;" >                                                    <input data-format="dd/MM/yyyy hh:mm" type="text" id="start_time" value="start time"></input>                                                    <span class="add-on">                                                        <i data-time-icon="icon-time" data-date-icon="icon-calendar">                                                        </i>                                                    </span>                                                </span>                                                <span id="datetimepicker_end" class="input-append date" style="width: 260px;" >                                                    <input data-format="dd/MM/yyyy hh:mm" type="text" id="end_time" value="end time"></input>                                                    <span class="add-on">                                                        <i data-time-icon="icon-time" data-date-icon="icon-calendar">                                                        </i>                                                    </span>                                                </span>                                            </div>                                            <p></p>                                            <input type="hidden" name="filter" id="status_filter" value="0">                                            <a href="javascript:void(0)" class="btn btn-success" id="btn_filter" style=" margin: 10px 0px 0px 0px;">                                                <i class="icon-zoom-in icon-white"></i>                                                  Filter                                                                                        </a>                                            <?php                                            if ($_SESSION["user_role"] != 3) {                                                ?>                                                <a href="javascript:void(0)" class="btn btn-success" id="btn_export" style="display:none; margin: 10px 0px 0px 0px;">                                                    <i class="icon-zoom-in icon-white"></i>                                                      Export to html                                                                                           </a>                                                <a href="javascript:void(0)" class="btn btn-success" id="btn_export_all_excel" style="margin: 10px 0px 0px 0px;">                                                    <i class="icon-zoom-in icon-white"></i>                                                      Export to excel                                                                                           </a>                                                <a href="javascript:void(0)" class="btn btn-success" id="btn_export_html" style="margin: 10px 0px 0px 0px;">                                                    <i class="icon-zoom-in icon-white"></i>                                                      Export to HTML                                                                                           </a>                                            <?php                                            }else {                                                ?>                                                <a href="javascript:void(0)" class="btn btn-success" id="btn_export_all_excel" style="margin: 10px 0px 0px 0px;">                                                    <i class="icon-zoom-in icon-white"></i>                                                    Export to excel                                                </a>                                            <?php                                            }                                            ?>                                            <iframe id="iframe_excel" name="iframe_excel" src="" class="hidden"></iframe>                                            <button  class="btn reset_search_filter" type="button" style=" margin: 10px 0px 0px 0px;">Cancel</button>                                            <a href="#" class="btn btn-success hidden" id="link_export_html" style="margin: 10px 0px 0px 0px;">                                                Link file export HTML                                                                                      </a>                                            <!-----------test----------->                                            <div style="float:left; display:inline-block;margin-right: 10px;margin-top: 25px;width: 100%;">                                                <?php                                                if ($_SESSION["user_role"] != 3) {                                                    ?>                                                    <a class="btn btn-success btn_show_hide_group"                                                       href="javascript:void(0)" id="group_1" rel="1" rev="PT">                                                        <i class="icon-zoom-in icon-white"></i>                                                        Ẩn nhóm PT                                                    </a>                                                    <a class="btn btn-success btn_show_hide_group"                                                       href="javascript:void(0)" id="group_2" rel="2" rev="AT">                                                        <i class="icon-zoom-in icon-white"></i>                                                        Ẩn nhóm AT                                                    </a>                                                <?php                                                }                                                ?>                                                <a class="btn btn-success btn_show_hide_group" href="javascript:void(0)" id="group_3" rel="3" rev="VNĐ">                                                    <i class="icon-zoom-in icon-white"></i>                                                    Ẩn nhóm VNĐ                                                </a>                                                <a class="btn btn-success btn_show_hide_group" href="javascript:void(0)" id="group_4" rel="4" rev="địa chỉ">                                                    <i class="icon-zoom-in icon-white"></i>                                                    Ẩn nhóm địa chỉ                                                </a>                                                <input type="hidden" name="hidden_group_1" value="0" id="hidden_group_1" >                                                <input type="hidden" name="hidden_group_2" value="0" id="hidden_group_2" >                                                <input type="hidden" name="hidden_group_3" value="0" id="hidden_group_3" >                                                <input type="hidden" name="hidden_group_4" value="0" id="hidden_group_4" >                                            </div>                                            <?php                                            if ($_SESSION["user_role"] != 3) {                                                ?>                                                <div >                                                    <div style="display:inline;float: left;font-weight: bold;margin-top: 10px;">Chọn trạng thái:                                                        <select name="order_by" id="display_color_by_status" style="width: 150px;" >                                                            <option value="" selected="selected">Theo trạng thái</option>                                                            <option value="0" >Store</option>                                                            <option value="1">Online</option>                                                            <option value="2">Hàng có sẵn</option>                                                            <option value="3">Đã nhận hàng</option>                                                            <option value="4">Đang shipping</option>                                                            <option value="5">Khách đã nhận</option>                                                            <option value="6">Hết hàng</option>                                                            <option value="7" >ORDER</option>                                                            <option value="8">Chưa chắc chắn</option>                                                        </select>                                                    </div>                                                </div>                                            <?php                                            }                                            ?>                                            <!----------end test --------->                                        </div>                                    </div>                                </div>                                <div class="row-fluid sortable">		                                    <div class="box span12">                                        <div class="box-header well" data-original-title>                                            <h2><i class="icon-user"></i> Danh sách đơn đặt hàng <b>"<?php echo $zen_order_data->zen_order_name; ?>"</b></h2>                                            <!--                                            <div class="box-icon">                                                                                                                                        <a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>                                                                                                                                    </div>-->                                        </div>                                        <input type="hidden" name="loadmore_customer_order" id="loadmore_customer_order" value="<?php echo $load_more; ?>">                                        <input type="hidden" name="page_customer_order" id="page_customer_order" value="2">                                        <input type="hidden" name="zen_order_id" id="zen_order_id" value="<?php echo $zen_order_id; ?>">                                        <input type="hidden" name="customer_order_id" id="customer_order_id" value="0">                                        <div style="padding: 10px;" id="box_content_customer_order"  ><!--                                            <div style="float:left; display:inline-block;margin-right: 10px;">--><!--                                                --><?php//                                                if ($_SESSION["user_role"] != 3) {//                                                    ?><!--                                                    <a class="btn btn-success btn_show_hide_group"--><!--                                                       href="javascript:void(0)" id="group_1" rel="1" rev="PT">--><!--                                                        <i class="icon-zoom-in icon-white"></i>--><!--                                                        Ẩn nhóm PT--><!--                                                    </a>--><!--                                                    <a class="btn btn-success btn_show_hide_group"--><!--                                                       href="javascript:void(0)" id="group_2" rel="2" rev="AT">--><!--                                                        <i class="icon-zoom-in icon-white"></i>--><!--                                                        Ẩn nhóm AT--><!--                                                    </a>--><!--                                                --><?php//                                                }//                                                ?><!--                                                <a class="btn btn-success btn_show_hide_group" href="javascript:void(0)" id="group_3" rel="3" rev="VNĐ">--><!--                                                    <i class="icon-zoom-in icon-white"></i>--><!--                                                    Ẩn nhóm VNĐ--><!--                                                </a>--><!--                                                <a class="btn btn-success btn_show_hide_group" href="javascript:void(0)" id="group_4" rel="4" rev="địa chỉ">--><!--                                                    <i class="icon-zoom-in icon-white"></i>--><!--                                                    Ẩn nhóm địa chỉ--><!--                                                </a>--><!----><!--                                                <input type="hidden" name="hidden_group_1" value="0" id="hidden_group_1" >--><!--                                                <input type="hidden" name="hidden_group_2" value="0" id="hidden_group_2" >--><!--                                                <input type="hidden" name="hidden_group_3" value="0" id="hidden_group_3" >--><!--                                                <input type="hidden" name="hidden_group_4" value="0" id="hidden_group_4" >--><!--                                            </div>-->                                            <?php                                            if ($_SESSION["user_role"] != 3) {                                                ?><!--                                                <div style=" display:inline-block">--><!--                                                    <div style="display:inline;float: left;font-weight: bold;">Chọn trạng thái:--><!--                                                        <select name="order_by" id="display_color_by_status" style="width: 150px;" >--><!--                                                            <option value="" selected="selected">Theo trạng thái</option>--><!----><!--                                                            <option value="0" >Store</option>--><!--                                                            <option value="1">Online</option>--><!--                                                            <option value="2">Hàng có sẵn</option>--><!--                                                            <option value="3">Đã nhận hàng</option>--><!--                                                            <option value="4">Đang shipping</option>--><!--                                                            <option value="5">Khách đã nhận</option>--><!--                                                            <option value="6">Hết hàng</option>--><!--                                                            <option value="7" >ORDER</option>--><!--                                                            <option value="8">Chưa chắc chắn</option>--><!--                                                        </select>--><!--                                                    </div>--><!----><!--                                                </div>-->                                                <div id="div_total">                                                    <table class="table table-striped table-bordered bootstrap-datatable datatable">                                                        <tr>                                                            <th>Tổng số khách hàng</th>                                                            <th>Tổng số sản phẩm</th>                                                            <?php                                                            if ($_SESSION["user_role"] == 1) {                                                                ?>                                                                <th>Tổng AT<br/>(EU)</th>                                                                <th>Tổng PT<br/>(EU)</th>                                                                <?php                                                            }                                                            ?>                                                            <th>Tổng tiền hàng<br/>(x1000 VNĐ)</th>                                                            <th>Tổng cọc<br/>(x1000 VNĐ)</th>                                                            <th>Tổng thừa<br/>(x1000 VNĐ)</th>                                                            <th>Tổng thiếu<br/>(x1000 VNĐ)</th>                                                        </tr>                                                        <tr>                                                            <td><?php echo $total_result["total_customer"]; ?></td>                                                            <td><?php echo $total_result["total_product"]; ?></td>                                                            <?php                                                            if ($_SESSION["user_role"] == 1) {                                                                ?>                                                                <td><?php echo number_format($total_result["total_at"]); ?></td>                                                                <td><?php echo number_format($total_result["total_pt"]); ?></td>                                                                <?php                                                            }                                                            ?>                                                            <td><?php echo number_format($total_result["total_order_money"] / 1000); ?></td>                                                            <td><?php echo number_format($total_result["total_payment"] / 1000); ?></td>                                                            <td><?php echo number_format($total_result["total_excess_cash"] / 1000); ?></td>                                                            <td><?php echo number_format($total_result["total_debit"] / 1000); ?></td>                                                        </tr>                                                    </table>                                                </div>                                                <?php                                            }                                            ?>                                            <div id="div_detail_order" style="overflow: auto;height: 700px;" >                                            <?php                                            $customer_order_id = 0;                                            $count = 0;                                            if ($_SESSION["user_role"] != 3) {                                                include_once 'templates/full_permision_order_detail.php';                                            } else {                                                include_once 'templates/view_permision_order_detail.php';                                            }                                            ?>                                            </div>                                            <input type="hidden" name="last_customer_order_id" id="last_customer_order_id" value="<?php echo $customer_order_id ?>">                                            <input type="hidden" name="var_count" id="var_count" value="<?php echo $count ?>">                                            <div id="loading" style="display:none;width: 220px; height: 19px;margin: 0 auto;"><img title="img/ajax-loaders/ajax-loader-7.gif" src="img/ajax-loaders/ajax-loader-7.gif"></div>                                        </div>                                    </div><!--/span-->                                </div><!--/row-->                            </div><!--/#content.span10-->                        </div><!--/fluid-row-->                        <?php include_once ('footer.php'); ?>                    </div><!--/.fluid-container-->                </div>            </div>        </div>        <!--vung  html ẩn-->            <!-- hien thi list ảnh sp-->        <div class="modal hide fade" id="photoList">            <div class="modal-header">                <button type="button" class="close" data-dismiss="modal">×</button>                <h3>Choose Image</h3>            </div>            <div class="modal-body" id="modal_body_list_image">                <input type="hidden" name="load_more_image" id="loadmore_image" value="1">                <input type="hidden" name="page_image" id="page_image" value="1">                <ul class="thumbnails gallery" id="list_photo_image" style="margin-left:0px;">                </ul>                <div id="loading" style="display:none;width: 220px; height: 19px;margin: 0 auto;"><img title="img/ajax-loaders/ajax-loader-7.gif" src="img/ajax-loaders/ajax-loader-7.gif"></div>            </div>            <div class="modal-footer">                <a href="#" class="btn" data-dismiss="modal">Close</a>            </div>        </div>        <!-- hien thi ảnh sp phóng to-->        <div class="modal hide fade" id="modal_photo_zoom">            <div class="modal-header">                <button type="button" class="close" data-dismiss="modal">×</button>                <h3>Choose Image</h3>            </div>            <div class="modal-body" id="photo_zoom">            </div>            <div class="modal-footer">                <a href="#" class="btn" data-dismiss="modal">Close</a>            </div>        </div>        <div style="display: none;" id="dialog-confirm" title="Cảnh báo trùng số phone">            <p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>Số phone đã tồn tai nhưng có tên FB khác.Ấn tiếp tục để update tên FB mới và thêm đơn hàng mới cho khách đã tồn tại.Ấn Cancel để hủy.</p>        </div>        <!-- hien thi đặt cọc-->        <div class="modal hide fade" id="modal_zen_payment" >            <div class="modal-header">                <button type="button" class="close" data-dismiss="modal">×</button>                <h3 style="font-family: arial;">Đặt cọc đợt hàng "<?php echo $zen_order_data->zen_order_name; ?>"</h3>            </div>            <div class="modal-body" id="content_zen_payment">                <div class="row-fluid sortable">                    <div class="box span12">                        <div class="box-header well" data-original-title>                            <h2><i class="icon-edit"></i> Thanh toán</h2>                        </div>                        <div class="box-content">                            <form class="form-horizontal">                                <fieldset>                                    <div class="control-group">                                        <label class="control-label" ></label>                                        <div class="controls">                                            <div class="alert alert-error" id="alert-error-payment" style="display:none">                                            </div>                                            <div class="alert alert-success" id="alert-success-payment" style="display:none"></div>                                        </div>                                    </div>                                    <div class="control-group">                                        <label class="control-label" for="">Tên khách hàng </label>                                        <div class="controls">                                            <input type="text" class="span6 typeahead" readonly value="" id="payment_customer_name"  >                                        </div>                                    </div>                                    <div class="control-group">                                        <label class="control-label" for="type_payment">Cách thanh toán </label>                                        <div class="controls">                                            <select id="type_payment">                                                <option value="2">Cọc VCB</option>                                                <option value="1">Cọc trực tiếp</option>                                                <option value="3">Refund VCB</option>                                                <option value="4">Refund trực tiếp</option>                                            </select>                                        </div>                                    </div>                                    <div class="control-group">                                        <label class="control-label" for="payment">Số tiền đặt cọc </label>                                        <div class="controls">                                            <input type="text" class="span6 typeahead numbersOnly" id="payment" style='display:inline-block' ><div style=' margin-left: 5px;display:inline-block'>.000 VNĐ</div>                                        </div>                                    </div>                                    <div class="control-group">                                        <label class="control-label" for="payment_date">Ngày đặt cọc </label>                                        <div class="controls"><!--                                            <input type="text" class="input-xlarge datepicker" id="payment_date" value="31/01/2014">-->                                            <span id="span_payment_date" class="input-append date" style="width: 260px;" >                                                <input data-format="dd/MM/yyyy hh:mm" type="text" id="payment_date" value="Ngày đặt cọc"></input>                                                <span class="add-on">                                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar">                                                    </i>                                                </span>                                            </span>                                        </div>                                    </div>                                    <div class="control-group">                                        <label class="control-label" for="payment_description">Ghi chú </label>                                        <div class="controls">                                            <textarea name="product_description" id="payment_description"></textarea>                                        </div>                                    </div>                                    <div class="form-actions">                                        <button type="button" class="btn btn-primary" id="save_payment">Save changes</button>                                        <button type="button" class="btn" id="reset">Cancel</button>                                    </div>                                </fieldset>                            </form>                           </div>                    </div><!--/span-->                </div><!--/row-->                <div class="row-fluid sortable">		                    <div class="box span12">                        <div class="box-header well" data-original-title>                            <h2><i class="icon-user"></i>Lịch sử thanh toán</h2>                        </div>                        <input type="hidden" name="payment_id" id="payment_id" value="0">                        <input type="hidden" name="payment_customer_order_id" id="payment_customer_order_id" value="">                        <div class="box-content" id="box_content_customer_order_payment" >                            <!--content payment-->                        </div>                    </div><!--/span-->                </div><!--/row-->            </div>            <div class="modal-footer">                <a href="#" class="btn" data-dismiss="modal">Close</a>            </div>        </div>        <!--hết vùng html ẩn-->        <!--form sửa ghi chú sản phẩm-->        <div class="modal hide fade" id="modal_zen_edit_note_product" >            <div class="modal-header">                <button type="button" class="close" data-dismiss="modal">×</button>                <h3 style="font-family: arial;">Sửa ghi chú sản phẩm</h3>            </div>            <div class="modal-body" id="content_zen_payment">                <div class="box-content">                    <input type="hidden" name="order_detail_id" id="popup_hidden_order_detail_id" value="0">                    <form class="form-horizontal">                        <fieldset>                            <div class="control-group">                                <label class="control-label" ></label>                                <div class="controls">                                    <div class="alert alert-error" id="alert-error-edit-note_product" style="display:none">                                    </div>                                    <div class="alert alert-success" id="alert-success--note-product" style="display:none"></div>                                </div>                            </div>                            <div class="control-group">                                <label class="control-label" for="">Nội dung </label>                                <div class="controls">                                    <textarea name="popup_note_product" id="popup_note_product" style="height: 120px"></textarea>                                </div>                            </div>                        </fieldset>                    </form>                </div>            </div>            <div class="modal-footer">                <button type="button" class="btn btn-primary" id="save_note_product" data-item-id="">Lưu ghi chú</button>                <a href="#" class="btn" data-dismiss="modal">Close</a>            </div>        </div>        <!--the end: sửa ghi chú sản phẩm-->        <!-- external javascript        ================================================== -->        <!-- Placed at the end of the document so the pages load faster -->    </body></html>